package com.bcu.team.comment.controller;

import com.bcu.team.comment.entity.Song;
import com.bcu.team.comment.service.SongService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@Api(tags = "歌曲模块")
@RestController
@RequestMapping("/api/song")
public class SongController {

    @Resource
    private SongService songService;

    @ApiOperation(value = "获取所有歌曲")
    @GetMapping(value = "/getAll")
    public List<Song> getAllSongs(){
        return songService.getAll();
    }

    @ApiOperation(value = "获取用户收藏的歌曲")
    @GetMapping(value = "/getSongsByUserId")
    public List<Song> getAllSongsByUserId(Integer userId){
        return songService.getAllSongsByUserId(userId);
    }

}
